using System;
using UnityEngine;
using Unity.VisualScripting;
using ResourceVerifyStartEventArgs = UnityGameFramework.Runtime.ResourceVerifyStartEventArgs;

namespace LS.UGFUnits
{
    [UnitShortTitle("Resource Verify")]
    [UnitSurtitle("Start")]
    public sealed class ResourceVerifyStart : FrameworkEventUnit<ResourceVerifyStartEventArgs>
    {
        protected override int EventId => ResourceVerifyStartEventArgs.EventId;
        protected override string HookName => UGFHookNames.ResourceVerifyStart;

        [DoNotSerialize]
        [PortLabelHidden]
        public ValueOutput Count
        {
            get;
            private set;
        }

        [DoNotSerialize]
        [PortLabelHidden]
        public ValueOutput TotalLength
        {
            get;
            private set;
        }

        protected override void Definition()
        {
            base.Definition();
            Count = ValueOutput<int>(nameof(Count));
            TotalLength = ValueOutput<long>(nameof(TotalLength));
        }

        protected override void AssignArguments(Flow flow, ResourceVerifyStartEventArgs args)
        {
            base.AssignArguments(flow, args);
            flow.SetValue(Count, args.Count);
            flow.SetValue(TotalLength, args.TotalLength);
        }
    }
}